<template>
  <div class="scheme_item">
    <div class="item_index">{{ index + 1 }}</div>
    <div class="item_name">
      <div class="name">{{ data.scheme_name ? data.scheme_name : data.task_name }}</div>
      <div class="bctype">{{ data.filter_name }}</div>
    </div>
    <div class="scheme_type">{{data.scheme_name ? '自动' : '跟单'}}</div>
    <div class="scheme_count" v-if="data.task_name != null && data.task_name != undefined && data.new_orders_count != 0">{{data.new_orders_count}}</div>
  </div>
</template>

<script setup>
const props = defineProps({
  data: Object,
  index: Number
})
</script>

<style lang="scss" scoped>
.scheme_item {
  border-bottom: 1px solid #ebebeb;
  display: flex;
  padding: 12px 0;
  cursor: pointer;
  position: relative;
}

.scheme_type{
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border-radius: 12px 0 0 0;
  right: 0;
  bottom: 0;
  width: 50px;
  height: 24px;
  background-color: var(--pcmain-color);
}

.scheme_count{
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border-radius: 50%;
  right: 4px;
  top: 4px;
  padding: 2px 6px;
  // width: 18px;
  // height: 18px;
  background-color: red;

}

.scheme_item:hover {
  background-color: #fff4ec;

  .bctype {
    background-color: #fff;
  }
}

.item_index {
  width: 24px;
  height: 24px;
  font-size: 24px;
  font-weight: bold;
  color: var(--pcmain-color);
  margin: 0 16px;
  text-align: center;
  line-height: 24px;
}

.item_name {
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  .name {
    margin-bottom: 8px;
    font-size: 16px;
    width: 160px;
    font-weight: 600;
    color: #333;
    display: -webkit-box !important;
    /* 使用弹性盒子模型 */
    -webkit-box-orient: vertical !important;
    /* 纵向排列 */
    -webkit-line-clamp: 2 !important;
    /* 限制为2行 */
    overflow: hidden !important;
    /* 隐藏溢出的内容 */
    // white-space: pre-wrap;
    text-overflow: ellipsis !important;
    /* 使用省略号 */
  }

  .bctype {
    width: max-content;
    padding: 2px 8px;
    font-size: 12px;
    height: 20px;
    display: flex;
    align-items: center;
    color: #8a8a8a;
    background-color: #f5f5f5;
    border-radius: 10px 10px 10px 0;
  }
}
</style>